package com.atguigu.gulimall.lgateway;

import com.alibaba.nacos.api.annotation.NacosProperties;
import com.alibaba.nacos.spring.context.annotation.config.EnableNacosConfig;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySource;
import com.alibaba.nacos.spring.context.annotation.config.NacosPropertySources;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
 * 1、开启服务注册发现，注册到nacos中
 */
@SpringBootApplication
// 你好
@EnableDiscoveryClient
//nacos相关配置，这里写的是需要读取的文件
@NacosPropertySources(value = {
        @NacosPropertySource(dataId = "gulimall-gateway.yml"),
        @NacosPropertySource(dataId = "application.properties")
})
@EnableNacosConfig(globalProperties = @NacosProperties(serverAddr = "localhost:8848", namespace = "gulimall-gatewawy"))
public class GulimallGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(GulimallGatewayApplication.class, args);
    }

}
